<?php
class VTableauStock {

	public function __construct($type, $lstArticles) {

		switch ($type) {
			case "entrepot":
				echo "<table>\n";
				echo "<tr><th>Type </th> <th> Modele </th><th> Quantit&eacute; </th></tr>\n";
				foreach ($lstArticles as $row ){
					echo "<tr>";
					echo "<td>" . $row["nomType"] . "</td>";
					echo "<td>" . $row["modele"] . "</td>";
					echo "<td>" . $row["stock"] . "</td>";
					echo "</tr>\n";
				}
				echo "</table>\n";
				break;
			case "entre":
				echo "<table >\n";
				echo "<tr><th>Entrepot</th><th> Quantit&eacute; </th></tr>\n";
				foreach ($lstArticles as $row ){
					echo "<tr>";
					echo "<td>" . $row["nomSite"] . "</td>";
					echo "<td>" . $row["stock"] . "</td>";
					echo "</tr>\n";
				}
				echo "</table>\n";
				break;
			case "sorti":
				echo "<table >\n";
				echo "<tr><th>Entrepot</th><th> Quantit&eacute; </th></tr>\n";
				foreach ($lstArticles as $row ){
					echo "<tr>";
					echo "<td>" . $row["nomSite"] . "</td>";
					echo "<td>" . $row["stock"] . "</td>";
					echo "</tr>\n";
				}
				echo "</table>\n";
				break;
		}
	}
}
?>